// Script assets have changed for v2.3.0 see
// https://help.yoyogames.com/hc/en-us/articles/360005277377 for more information
function ActivateHatCat(){
	var _hasHat = (global.iLifted != noone) && (global.iLifted.object_index == oHat);
	switch(global.questStatues[? "TheHatQuest"])
	{
		case 0: //任务未开始
		{
			//玩家可能手上已经有帽子了
			if(_hasHat)
			{
				//完成任务
				NewTextBox("哇塞！我啥还没问呢你就帮我找到了帽子！",2);
				NewTextBox("你真是个英雄！",2);
				global.questStatues[? "TheHatQuest"] = 2;
				with(oQuestNPC) sprite_index = sQuestieHat;
				with(oHat) instance_destroy();
				global.iLifted = noone;
				
				with(oPlayer)
				{
					spriteIdle = sPlayer;
					spriteRun = sPlayerRun;
				}
			}
			else
			{
				//接下任务	
				NewTextBox("你好！你看起来像个冒险家！",2);
				NewTextBox("你能帮我找到我丢失的帽子吗？", 2, 
				["4：当然！", "5：这我不干！"]);
				
				
			}
			
		}break;
		
		case 1://正在进行任务
		{
			if(_hasHat)
			{
				//完成任务	
				NewTextBox("哇塞！你帮我找到了帽子！",2);
				NewTextBox("你真是个英雄！",2);
				global.questStatues[? "TheHatQuest"] = 2;
				with(oQuestNPC) sprite_index = sQuestieHat;
				with(oHat) instance_destroy();
				global.iLifted = noone;
				
				with(oPlayer)
				{
					spriteIdle = sPlayer;
					spriteRun = sPlayerRun;
				}
			}
			else
			{
				//线索提示	
				NewTextBox("我想我把它丢在东北方向的恐怖山洞了", 2);
				NewTextBox("你可能需要到那去", 2);
			}
			
		}break;
		
		case 2://完成任务
		{
			NewTextBox("十分感谢你！", 2);
		}break;

	}
}